import {request} from "@/utils/request";

//过滤字段
export function filterMaterialField(data, callback) {
    return request({
        url: '/raw_material/filter_field',
        method: 'get',
        data,
        isYarn: true,
    }, callback);
}

//筛选原料
export function filterMaterial(data, callback) {
    return request({
        url: '/raw_material/filter',
        method: 'get',
        data,
        isYarn: true,
    }, callback);
}

//过滤原料批次
export function filterMaterialBatch(data, callback) {
    return request({
        url: '/raw_material_batch/filter',
        method: 'get',
        data,
        isYarn: true,
    }, callback);
}

//加载拼毛发货单
export function loadSendOutData(data, callback) {
    return request({
        url: "/material_send_out/list",
        method: 'get',
        data,
        isYarn: true,
        isEmpty: true,
    }, callback);
}
//加载拼毛发货单详情
export function loadSendOutDetailData(data, callback) {
    return request({
        url: "/material_send_out/detail",
        method: 'get',
        data,
        isYarn: true,
        isId: true,
    }, callback);
}

//加载原料包详情
export function loadMaterialPackageDetail(data, callback) {
    return request({
        url: "/material_package/detail",
        method: "get",
        data,
        isYarn: true,
        isId: true,
    }, callback);
}

//加载原料包关联
export function loadMaterialPackageByRefData(data, callback) {
    return request({
        url: "/material_package/list_by_ref",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

//加载原料列表 按排缸
export function loadMaterialPackageByVatScheduleData(data, callback) {
    return request({
        url: "/material_package/list_by_vat_schedule",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

//确认发货
export function materialSendOutConfirm(data, callback) {
    return request({
        url: "/material_send_out/send_confirm",
        method: "post",
        data,
        type: "json",
        isYarn: true,
    }, callback);
}

//解绑关联(删除)
export function delMaterialPackageFromRef(data, callback) {
    return request({
        url: "/material_package/del_from_ref",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callback);
}

//确认接收
export function materialReceiveConfirm(data, callback) {
    return request({
        url: "/material_send_out/receive_confirm",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callback);
}

//增加原料包
export function addMaterialPackFromPlanMaterial(data, callback) {
    return request({
        url: "/material_package/add_from_plan_material",
        method: "post",
        data,
        type: "json",
        isYarn: true,
    }, callback);
}

//加载原料包 根据原料计划
export function loadMaterialPackByPlanMaterialData(data, callback) {
    return request({
        url: "/material_package/list_by_plan_material",
        method: "get",
        data,
        isYarn: true,
        isEmpty: true,
    }, callback);
}

//删除原料包
export function delMaterialPackage4Manual(data, callback) {
    return request({
        url: "/material_package/del_4_manual",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callback);
}

//删除原料包
export function delMaterialPackage4PlanMaterial(data, callback) {
    return request({
        url: "/material_package/del_from_plan_material",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callback);
}

//增加原料包
export function addMaterialPack(data, callback) {
    return request({
        url: "/material_package/add_material_pack",
        method: "post",
        data,
        type: "json",
        isYarn: true,
    }, callback);
}

//删除原料包
export function delMaterialPackage(data, callback) {
    return request({
        url: "/material_package/del_material_pack",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callback);
}

//加载原料包 根据原料批次
export function loadMaterialPackageByBatchData(data, callback) {
    return request({
        url: "/material_package/list_by_material_batch",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

//确认包入库
export function confirmPackIn(data, callback) {
    return request({
        url: "/material_package/confirm_pack_in",
        method: "post",
        data,
        type: "json",
        isYarn: true,
    }, callback);
}